/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作
const install = (Vue, vm) => {

	// 参数配置对象
	const config = vm.vuex_config;

	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	vm.$u.api = {

		// 基础服务：登录登出、身份信息、菜单授权、切换系统、字典数据等
		lang: (params = {}) => vm.$u.get('/lang/' + params.lang),
		index: (params = {}) => vm.$u.get(config.adminPath + '/index', params),
		login: (params = {}) => vm.$u.post(config.adminPath + '/login', params),
		logout: (params = {}) => vm.$u.get(config.adminPath + '/logout', params),
		authInfo: (params = {}) => vm.$u.get(config.adminPath + '/authInfo', params),
		menuTree: (params = {}) => vm.$u.get(config.adminPath + '/menuTree', params),
		switchSys: (params = {}) => vm.$u.get(config.adminPath + '/switch/' + params.sysCode),
		dictData: (params = {}) => vm.$u.get(config.adminPath + '/sys/dictData/treeData', params),
		dictListData: (params = {}) => vm.$u.get(config.adminPath + '/sys/dictData/listData', params),
		// 账号服务：验证码接口、忘记密码接口、注册账号接口等
		validCode: (params = {}) => vm.$u.getText('/validCode', params),
		getFpValidCode: (params = {}) => vm.$u.post('/account/getFpValidCode', params),
		savePwdByValidCode: (params = {}) => vm.$u.post('/account/savePwdByValidCode', params),
		getRegValidCode: (params = {}) => vm.$u.post('/account/getRegValidCode', params),
		saveRegByValidCode: (params = {}) => vm.$u.post('/account/saveRegByValidCode', params),


		// APP公共服务
		upgradeCheck: () => vm.$u.post('/app/upgrade/check', { appCode: config.appCode, appVersion: config.appVersion }),
		commentSave: (params = {}) => vm.$u.post('/app/comment/save', params),

		// 个人信息修改
		user: {
			infoSaveBase: (params = {}) => vm.$u.post(config.adminPath + '/sys/user/infoSaveBase', params),
			infoSavePwd: (params = {}) => vm.$u.post(config.adminPath + '/sys/user/infoSavePwd', params),
			infoSavePqa: (params = {}) => vm.$u.post(config.adminPath + '/sys/user/infoSavePqa', params),
		},

		// 员工用户查询
		empUser: {
			listData: (params = {}) => vm.$u.get(config.adminPath + '/sys/empUser/listData', params),
		},

		// 组织机构查询
		office: {
			treeData: (params = {}) => vm.$u.get(config.adminPath + '/sys/office/treeData', params),
		},

		// 增删改查例子
		testData: {
			form: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/form', params),
			list: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/listData', params),
			save: (params = {}) => vm.$u.postJson(config.adminPath + '/test/testData/save', params),
			disable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/disable', params),
			enable: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/enable', params),
			delete: (params = {}) => vm.$u.post(config.adminPath + '/test/testData/delete', params),
		},

		shop: {
			// 登录配置
			form: (params = {}) => vm.$u.get('/f/shop/shopAppsetLogin/loginForm', params),
			// 获取主页配置
			// homeForm: (params = {}) => vm.$u.get(config.adminPath+'/shop/sethome/shopAppsetHome/fbData', params),
			homeForm: (params = {}) => vm.$u.get(config.adminPath + '/shop/api/homeSetData', params),
			// 获取存货明细配置
			// shopInvForm: (params = {}) => vm.$u.get(config.adminPath+'/shop/shopInv/form', params),
			shopInvForm: (params = {}) => vm.$u.get(config.adminPath + '/shop/api/invSetData', params),


			//  获取产品系列列表
			proClsListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/proClsListData', params),

			//  获取公告详情
			noticeListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/noticeListData', params),
			noticeSetData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/noticeSetData', params),

			//  获取促销详情
			sellSetData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/sellSetData', params),

			// 分类
			invClsListData: (params = {}) => vm.$u.get(config.adminPath + '/shop/api/invClsListData', params),
			invListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/invListData', params),

			invExtClsListData: (params = {}) => vm.$u.get(config.adminPath + '/shop/api/invExtClsListData', params),
			invExtListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/invExtListData', params),



			// 获取用户关联客户对照
			findUserCusList: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/findUserCusList', params),

			// 切换门店 
			switchCus: (params = {}) => vm.$u.get(config.adminPath + '/switchCus/' + params.cusCode),

			// 授权绑定
			// bindWxOpenid: (params = {}) => vm.$u.post(config.adminPath+'/bindWxOpenid', params),
			bindWxOpenid: (params = {}) => vm.$u.post('/weixinMa/bindWxOpenid', params),
			// 解绑
			cleanWxOpenid: (params = {}) => vm.$u.post('/weixinMa/cleanWxOpenid', params),

			// 获取openId
			getOpenId: (params = {}) => vm.$u.post('/weixinMa/getOpenId', params),


			// 新增购物车
			addToCart: (params = {}) => vm.$u.post(config.adminPath + '/shop/car/shopCar/addToCart', params),
			// 购物车列表
			// cartListData: (params = {}) => vm.$u.post(config.adminPath+'/shop/car/shopCar/listData', params),
			cartListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/car/shopCar/cartListData', params),

			// 删除购物车
			cleanAllCart: (params = {}) => vm.$u.post(config.adminPath + '/shop/car/shopCar/cleanAllCart', params),
			// 修改数量购物车
			updateCount: (params = {}) => vm.$u.post(config.adminPath + '/shop/car/shopCar/updateCount', params),


			// 其它图片地址
			setListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/other/set/listData', params),

			// 我的账户
			wecharCusMoney: (params = {}) => vm.$u.post(config.adminPath + '/setting/price/wecharCusMoney/listData', params),
			getCusMoney: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/getCusMoney', params),

			// 地址
			cusAddress: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/cusAddress', params),

			// 物流
			orderInfo: (params = {}) => vm.$u.post(config.adminPath + '/kdn/api/orderInfo', params),

			wlInfo: (params = {}) => vm.$u.post(config.adminPath + '/kdn/api/wlInfo', params),

			wlTest: (params = {}) => vm.$u.post(config.adminPath + '/kdn/api/wlTest', params),




			// 获取门店信息
			getCurCus: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/getCurCus', params),

			// 获取当前运营中心OR运管中心对应的门店列表
			findMnCusListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/findMnCusListData', params),

			// 获取结算信息
			shopCarBalanceForm: (params = {}) => vm.$u.post(config.adminPath + '/shop/api/shopCarBalanceForm', params),


			// 提交订单 生成销售订单
			saveOrderFromShopCar: (params = {}) => vm.$u.postJson(config.adminPath + '/shop/order/soMain/saveOrderFromShopCar', params),

			// 订单列表
			orderListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/soMain/orderListData', params),

			// 订单状态数量
			orderStatusCount: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/soMain/orderStatusCount', params),

			// 确定收货
			confirm: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/soMain/confirm', params),

			// 删除
			delete: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/soMain/delete', params),

			// 延长
			delay: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/soMain/delay', params),


			// 获取消息订阅模板

			getTempleteIda: (params = {}) => vm.$u.post('/weixinMa/getTempleteId', params),

			// 可开票订单列表
			kpListData: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/soMain/kpListData', params),

			// 抬头列表
			ttlistData: (params = {}) => vm.$u.post(config.adminPath + '/bas/cus/basCusKpinfo/listData', params),
			// 抬头删除
			ttdelete: (params = {}) => vm.$u.post(config.adminPath + '/bas/cus/basCusKpinfo/delete', params),
			// 抬头保存
			ttsave: (params = {}) => vm.$u.post(config.adminPath + '/bas/cus/basCusKpinfo/save', params),

			// 默认开票信息
			defCusInfo: (params = {}) => vm.$u.post(config.adminPath + '/bas/cus/basCusKpinfo/defCusInfo', params),

			// 确定开票申请
			saveBySel: (params = {}) => vm.$u.postJson(config.adminPath + '/shop/order/cusFpApply/saveBySel', params),

			// 历史
			fpApplylistData: (params = {}) => vm.$u.post(config.adminPath + '/shop/order/cusFpApply/listData', params),

			// 历史详情
			fpApplyForm: (params = {}) => vm.$u.get(config.adminPath + '/shop/order/cusFpApply/form', params),

			// 文件
			fileList: (params = {}) => vm.$u.post(config.adminPath + '/file/fileList', params),


		},
		// 工作流引擎
		bpm: {
			myRuntimeList: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmMyRuntime/listData', params),
			myRuntimeForm: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmMyRuntime/form', params),
			myTaskList: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmMyTask/listData', params),
			myTaskForm: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmMyTask/form', params),
			getProcIns: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmRuntime/getProcIns', params),
			getTask: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/getTask', params),
			stop: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmRuntime/stop', params),
			stopProcess: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmRuntime/stopProcess', params),
			claim: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/claim', params),
			complete: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/complete', params),
			turn: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/turn', params),
			turnTask: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/turnTask', params),
			back: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/back', params),	
			backTask: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/backTask', params),
			move: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/move', params),
			moveTask: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/moveTask', params),
			rollback: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmTask/rollback', params),
			// /bpm/bpmMyTask/typeData
			typeData: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmMyTask/typeData', params),
			// /bpm/bpmMyTask/countData
			countData: (params = {}) => vm.$u.post(config.adminPath + '/bpm/bpmMyTask/countData', params),
			bpmTaskDeForm: (params = {}) => vm.$u.post(config.adminPath+'/bpm/bpmTaskDef/form', params),
			
			
		},
		
		// 爱思帝start 
		asd: {
			findMolds: (params = {}) => vm.$u.post(config.adminPath + '/app/api/findMolds', params),
			// /app/api/saveBatch
			saveBatch: (params = {}) => vm.$u.postJson(config.adminPath + '/app/api/saveBatch', params),
			// 
			useListData: (params = {}) => vm.$u.post(config.adminPath + '/mold/use/asdMoldUse/listData', params),
			// /mold/repair/asdMoldUpdate/listData
			repairListData: (params = {}) => vm.$u.post(config.adminPath + '/mold/repair/asdMoldUpdate/listData', params),
			// 
			checkFunAndBar: (params = {}) => vm.$u.post(config.adminPath + '/asd/barcode/checkFunAndBar', params),
			// '/bas/oper/treeData
			operTreeData: (params = {}) => vm.$u.post(config.adminPath + '/bas/oper/treeData', params),
			// /mold/repair/asdMoldUpdate/save
			repairSave: (params = {}) => vm.$u.postJson(config.adminPath + '/mold/repair/asdMoldUpdate/save', params),
			// /mold/repair/asdMoldUpdate/form
			repairForm: (params = {}) => vm.$u.post(config.adminPath + '/mold/repair/asdMoldUpdate/form', params),
			// /bas/mold/basMoldInvRef/findInvByCodeAndLastNum
			findInvByCodeAndLastNum: (params = {}) => vm.$u.post(config.adminPath + '/bas/mold/basMoldInvRef/findInvByCodeAndLastNum', params),
			
			// /mold/fal/asdMoldFal/save
			falSave: (params = {}) => vm.$u.postJson(config.adminPath + '/mold/fal/asdMoldFal/save', params ),
			// /mold/barcode/analysisMolXpp
			analysisMolXpp: (params = {}) => vm.$u.post(config.adminPath + '/mold/barcode/analysisMolXpp', params),
			// /app/api/analysisMold?barCode=1864217373585477632
			analysisMold: (params = {}) => vm.$u.post(config.adminPath + '/app/api/analysisMold', params),
			// /mold/keep/asdMoldKeep/listData
			keepListData: (params = {}) => vm.$u.post(config.adminPath + '/mold/keep/asdMoldKeep/listData', params),
			// /mold/keep/asdMoldKeep/save
			keepSave: (params = {}) => vm.$u.postJson(config.adminPath + '/mold/keep/asdMoldKeep/save', params),
			keepForm: (params = {}) => vm.$u.get(config.adminPath + '/mold/keep/asdMoldKeep/form', params),
			// /bas/mold/basMold/form
			moldForm: (params = {}) => vm.$u.get(config.adminPath + '/bas/mold/basMold/form', params),
			// 
			addUseQty: (params = {}) => vm.$u.post(config.adminPath + '/bas/mold/basMold/addUseQty', params),
			
			// bas/basInventory/listData
			basInventoryListData: (params = {}) => vm.$u.get(config.adminPath + '/bas/basInventory/listData', params),
			
			empUserTreeData: (params = {}) => vm.$u.get(config.adminPath + '/sys/office/treeData', params),
			findMoldsByInv: (params = {}) => vm.$u.get(config.adminPath + '/app/api/findMoldsByInv', params),
			// 
			empUserListData: (params = {}) => vm.$u.get(config.adminPath + '/sys/empUser/listData', params),
			
			// /app/api/findMoldStatus
			findMoldStatus: (params = {}) => vm.$u.get(config.adminPath + '/app/api/findMoldStatus', params),
		}
		// 爱思帝end 

	};

}

export default {
	install
}